import requests

from config import BASE_URL


class CourseApi(object):

    def __init__(self):
        self.add_course_url = BASE_URL + "/api/clues/course"


    # 定义新增课程的方法
    def add_course(self,token,name,subject="6",price=899,applicablePerson="2",info=""):
        heade = {"Authorization":token}
        add_course_data =  {"name": name,
                             "subject": subject,
                             "price": price,
                             "applicablePerson": applicablePerson,
                             "info": info}
        resposne = requests.post(self.add_course_url,json=add_course_data,headers=heade)
        return resposne